<?php

if (!defined('PHOX') or !constant('PHOX')) die('Direct access not allowed!');

/**
 * index
 *
 * Default controller
 *
 * Index application logic
 * an example ;) 
 * 
 * @uses BaseController
 * @package controller
 * @version 1.0
 * @author Pedro Eugénio <voxmachina@sapo.pt>
 * @license GPL v.3
 */
class index implements BaseController
{
  
 /**
  * index action
  * 
  * @return void
  */
  public function index()
  {
    $fc     = FrontController::getInstance();
    $params = $fc->getParams();

    $view       = new BaseView();
    $view->name = ( isset( $params['name'] ) && $params['name'] != '' ) ? $params['name'] : 'no name?';
    $view->sos  = ( isset( $params['name'] ) && $params['name'] != '' ) ? '' : '<a href="index/index/name/YOURNAME_HERE">try this</a>';
    $result     = $view->render('index'); // apply and render index template: index.php

    $fc->setBody($result);
  }
}

?>
